package com.github.slprj.slake.net;

import java.nio.ByteBuffer;

/**
 * ByteBuffer解析器
 *
 * @author YangXiaoLong
 * 2022/9/17 10:12
 */
public class ByteBufferDecoder extends Decoder {
    public static final ByteBufferDecoder INSTANCE = new ByteBufferDecoder();

    @Override
    public Object decode(ByteBuffer buffer) {
        ByteBuffer buf = ByteBuffer.allocate(buffer.remaining());
        buf.put(buffer);
        buf.flip();
        return buf;
    }
}
